#include <stdio.h>
#include <math.h>
 int main()
{
	int a, b, c, i, k = 0, d;
	scanf("%d %d", &a, &b);
	for (c = a; c <= b; c++) 
{
		d = 1;
		for (i = 2; i <= sqrt(c); i++)
	    if (c % i == 0) {
				d = 0;
				break;
		                }
		if (d == 1)
			k++;
		if (c == b)
			printf("%d", k);
 
}
 
}